/*
 * Copyright (C) 2019 xuexiangjys(xuexiangjys@163.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.liser.southernstar.collection.model.vo;

import android.content.Context;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.AbsoluteSizeSpan;

import com.kunminx.linkage.bean.BaseGroupedItem;
import com.liser.southernstar.neleme.utils.ViewUtils;

import java.math.BigDecimal;

/**
 * 饿了么列表简单演示
 *
 * @author xuexiang
 * @since 2019-11-25 22:52
 */
public class GoodsGroupedItem2 extends BaseGroupedItem<GoodsGroupedItem2.ItemInfo> {

    public GoodsGroupedItem2(boolean isHeader, String header) {
        super(isHeader, header);
    }

    public GoodsGroupedItem2(ItemInfo item) {
        super(item);
    }

    public static class ItemInfo extends BaseGroupedItem.ItemInfo {

        private String fk_biz;

        private String biz_name;

        private String fk_genre;

        private String genre_name;

        private String main_img;

        private String figure;

        private String id;

        private String name;

        private String describe;

        private BigDecimal discount;

        private BigDecimal price;

        private int selectCount;

        public ItemInfo(String title, String group) {
            super(title, group);
        }

        public String getFk_biz() {
            return fk_biz;
        }

        public void setFk_biz(String fk_biz) {
            this.fk_biz = fk_biz;
        }

        public String getBiz_name() {
            return biz_name;
        }

        public void setBiz_name(String biz_name) {
            this.biz_name = biz_name;
        }

        public String getFk_genre() {
            return fk_genre;
        }

        public void setFk_genre(String fk_genre) {
            this.fk_genre = fk_genre;
        }

        public String getGenre_name() {
            return genre_name;
        }

        public void setGenre_name(String genre_name) {
            this.genre_name = genre_name;
        }

        public String getMain_img() {
            return main_img;
        }

        public void setMain_img(String main_img) {
            this.main_img = main_img;
        }

        public String getFigure() {
            return figure;
        }

        public void setFigure(String figure) {
            this.figure = figure;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getDescribe() {
            return describe;
        }

        public void setDescribe(String describe) {
            this.describe = describe;
        }

        public BigDecimal getDiscount() {
            return discount;
        }

        public void setDiscount(BigDecimal discount) {
            this.discount = discount;
        }

        public BigDecimal getPrice() {
            return price;
        }

        public void setPrice(BigDecimal price) {
            this.price = price;
        }

        public int getSelectCount() {
            return selectCount;
        }

        public void setSelectCount(int selectCount) {
            this.selectCount = selectCount;
        }

        public SpannableString getStrPrice(Context context) {
            String priceStr = String.valueOf(getPrice());
            SpannableString spanString = new SpannableString("¥" + priceStr);
            AbsoluteSizeSpan span = new AbsoluteSizeSpan(ViewUtils.sp2px(context, 11));
            spanString.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
            return spanString;
        }

        public SpannableString getStrPrice(Context context, BigDecimal price) {
            String priceStr = String.valueOf(price);
            SpannableString spanString = new SpannableString("¥" + priceStr);
            AbsoluteSizeSpan span = new AbsoluteSizeSpan(ViewUtils.sp2px(context, 11));
            spanString.setSpan(span, 0, 1, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
            return spanString;
        }
    }
}
